fix(codex): freeze verified context windows per turn - #3488
Conversation
|
| Filename | Overview |
|---|---|
| packages/maker-core/src/agents/codex/index.ts | Resolves the verified route context window at thread-config assembly time and conditionally forwards only positive integers. |
| packages/maker-core/src/agents/codex/index.test.ts | Covers new threads, resumed threads, unverified metadata, and stale-daemon recovery following a model switch. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Selected provider and catalog model] --> B[Resolve verified context window]
B --> C{Positive integer?}
C -->|Yes| D[Add model_context_window to thread config]
C -->|No| E[Omit override]
D --> F[Start or resume Codex thread]
E --> F
Reviews (1): Last reviewed commit: "fix(codex): pass verified context window..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e10ee114a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@yuaiccc 👋 这个 PR 还有 1 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
MagicLizi
left a comment
There was a problem hiding this comment.
格式门未通过:PR 描述缺仓库模板要求的段落「这次改了什么 / 怎么验证的 / 风险」。
当前描述用了 Summary / Scope / Testing,请改写成模板中的三段(可以把现有内容搬进去),补全后再请求审查。
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 000153bda2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5691eb535d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@yuaiccc 👋 这个 PR 还有 2 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41fd0ec76d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce6ae79ba8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 98d3349eb8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@yuaiccc 👋 这个 PR 还有 1 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
这些问题已在当前 head 的后续 commit 中修复(格式门/安全门已通过),自动 dismiss 旧的 CHANGES_REQUESTED 以解除合并阻塞。
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
cindy/packages/maker-core/src/agents/codex/index.ts
Lines 5718 to 5722 in 9eadb76
当 model/list 预检失败、超时或未返回默认项时,新建会话仍会以 gpt-5 哨兵执行 thread/start,因此初始 config 没有 model_context_window;这里从响应取得具体模型后只更新两个可变字段,没有像冷恢复路径那样重新配置这个尚无 rollout 的线程,首轮仍按 Codex 基础窗口运行。相较已有评论,本版的新证据是冷恢复和 stale-daemon 分支已经增加补偿重应用,而该 ThreadStart 响应分支仍未设置 pending 标记或替换未使用线程。请在暴露 handle 前用解析后的模型重建线程配置。 docs/dev-rules/maker-core-and-agent-behavior.mdL66-L68
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d5d1711d8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b3429838c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@junshanxu 👋 这个 PR 还有 1 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
181c1c8 to
1bf8f66
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1bf8f664cd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review please review the latest commit 1bf8f66. This is the converged minimal fix: verified provider/model context windows, send-time route snapshot, deferred idle reapply, and serialized provider/model switches; sentinel probing and permission/reviewer state changes are intentionally out of scope. |
1bf8f66 to
c0d10cf
Compare
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
当前提交 c0d10cf 的范围内 review 已收敛,Codex 最新审查无 major issue,未解决 thread 为 0。 目前唯一阻塞是 CI 的 Linux unit tests (2/2):未改动的 |
|
@junshanxu 👋 这个 PR 目前与 请在本地 merge 最新的 |
Signed-off-by: yuaiccc <yuaiccc@aliyun.com>
c0d10cf to
3cba929
Compare
|
已将 PR 变基到最新 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3cba9299ae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const admissionTurnWorkspaceConfig = currentTurnWorkspaceConfig({ | ||
| allowInactiveReadonlyProfile: true, | ||
| }); |
There was a problem hiding this comment.
当调用方先发起但尚未 await 完成 setModel()、紧接着调用 send() 时,模型任务已经排入 modelChangeChain,但其主体尚未执行;这里先冻结旧路由的 approvalsReviewer,随后才在 6121–6122 行等待切换完成,最终会把新模型/provider 与旧审批能力组合。例如从支持原生 reviewer 的 OAuth 路由切到不支持的路由时,本轮仍发送 auto_review,可能直接失败;反向切换则会错误退回人工审批。与先前关于输入准备期间切换的评论不同,本版的新证据是“发送前已排队”的切换也因快照早于 await queuedChanges 而被拆成两套路由状态;应在等待链完成后冻结审批配置,或把审批能力纳入同一个路由快照。
AGENTS.md reference: AGENTS.md:L79-L81
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3cba9299ae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| assertCurrentHost('thread/resume retry subscribe'); | ||
| host.subscribeThread(threadId, handlers); | ||
| const resumeModel = mutableModel; | ||
| const resumeServiceTierGeneration = serviceTierMutationGeneration; |
There was a problem hiding this comment.
当 send() 已冻结 standard 路由后,用户在异步输入准备或首次 turn/start 在途期间调用 setFastMode(true),若该请求随后以 thread not found 进入 stale-daemon 恢复,这里读取的是切换后的 serviceTierMutationGeneration,但下面的 resumeParams 仍发送冻结的 turnRoute.serviceTier。因此 resume 返回的 standard 状态会被误判为同代权威结果,并将 mutableServiceTier 及重试 turn 都改回 standard,导致用户刚开启的 Fast 本轮和后续都丢失。请将 service-tier 代次纳入冻结路由快照并据此校验响应,或在检测到较新的 mutation 时保留并补推最新值。
Useful? React with 👍 / 👎.
|
@junshanxu 👋 这个 PR 还有 2 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
1 similar comment
|
@junshanxu 👋 这个 PR 还有 2 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
|
Closing this PR by maintainer direction. The remaining work crosses Codex core thread/profile lifecycle and has accumulated unresolved review discussions; it should be reconsidered only as a separately scoped, minimal proposal with an explicit core-owner review. The branch is intentionally retained for reference; no merge. |
这次改了什么
摘要
将已验证的自定义模型 context window 作为线程级配置传给 Codex,并把模型/provider/effort/service tier/线程配置冻结在发送入口。异步准备输入期间发生的切换从下一条消息生效。
变更类型
fix缺陷修复test测试补充范围
gpt-5sentinel 探测;approval/permission/reviewer 状态机扩展;外部 API、IPC、数据库或 wire schema 变化;Issue 维护者确认:PR #3488 架构改动(Codex 核心路径 / 大 diff) #3536 处理。UI 变化
不涉及。
怎么验证的
自动验证
手工验证
不涉及实机 UI;本次无需使用本机 Cindy。已在受控 fake app-server host 中验证新建、恢复、空闲切换和异步输入快照调用序列。
未执行的验证
pnpm test:unit:related曾在隔离 worktree 的临时依赖解析不完整时运行,出现跨 package collect failure,不能作为通过证据。Desktop 全量 typecheck 在同一隔离环境中无输出超时后停止;未将其标记为通过。定向 Codex/Desktop 测试与 Desktop ESLint 已通过。推送后的 GitHub
client-ci:Linux unit tests (1/2)、Windows 两个 shard、Desktop Git integration、verify-checks 和 DCO 通过;Linux unit tests (2/2) 因未改动的apps/desktop/src/main/maker-host/__tests__/codexProxyHost.test.ts:1545 秒超时失败,verify随之失败。当前凭证无 repository admin 权限,无法重跑该失败 job。风险
风险分类
影响与回滚
本 PR 不引入 sentinel 探测,也不扩大 approval/permission/reviewer 体系。等待维护者审批,不合并。